<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1.0">
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta charset="UTF-8">
    <title>Test</title>
</head>

<body>
    <h1>hello</h1>
    <button id="myButton">Send Message</button>

    <script>
        window.eleMsg.send('message-to-index', 'Hello from the HTML page!');

        document.getElementById('myButton').addEventListener('click', () => {
            // 使用eleMsg对象发送消息
            window.eleMsg.send('message-to-index', 'Hello from the HTML page!');
        });
    </script>
</body>

</html>